#include "searchAlgo.h"
#include <cassert>
#include <iostream>

Nodes::Nodes(const int board[][DIMENSION], const Nodes * parent_Node)
{
    for(register int x=0; x<DIMENSION; x++)
    {
        for(register int y=0; y<DIMENSION; y++)
        {
            _board[x][y] = board[x][y];
        }
    }

    this->parent_Node = parent_Node;
}

Nodes::~Nodes()
{

}

Nodes & Nodes::operator = (const Nodes & rightNode)
{
    for(register int x=0; x<DIMENSION; x++)
    {
        for(register int y=0; y<DIMENSION; y++)
        {
            _board[x][y] = rightNode._board[x][y];
        }
    }

    return *this;
}

/*int & Nodes::operator [] (int index)
{
    assert (index>=0 && index<DIMENSION);

    return *(_board[index]);
}*/

void Nodes::getBoard(int out_board[][DIMENSION]) const
{
    for(register int x=0; x<DIMENSION; x++)
    {
        for(register int y=0; y<DIMENSION; y++)
        {
            out_board[x][y] = _board[x][y];
        }
    }
}

const Nodes * Nodes::getParent() const
{
    return parent_Node;
}
